package firear.injectsms;

import android.os.Binder;
import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException;
import android.util.Log;

public final class EntryClass {
	static final String TAG = "TTT"; // accessed from inner class

	private static final class ProxyUiccSmsController extends Binder {

		private static final java.lang.String DESCRIPTOR = "com.android.internal.telephony.ISms";
		private IBinder mBinder;
		static final int TRANSACTION_getAllMessagesFromIccEf = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
		static final int TRANSACTION_getAllMessagesFromIccEfForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
		static final int TRANSACTION_updateMessageOnIccEf = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
		static final int TRANSACTION_updateMessageOnIccEfForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
		static final int TRANSACTION_copyMessageToIccEf = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
		static final int TRANSACTION_copyMessageToIccEfForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
		static final int TRANSACTION_sendData = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
		static final int TRANSACTION_sendDataForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
		static final int TRANSACTION_sendText = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
		static final int TRANSACTION_sendTextForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9);
		static final int TRANSACTION_injectSmsPdu = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10);
		static final int TRANSACTION_sendMultipartText = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11);
		static final int TRANSACTION_sendMultipartTextForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12);
		static final int TRANSACTION_enableCellBroadcast = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13);
		static final int TRANSACTION_enableCellBroadcastForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14);
		static final int TRANSACTION_disableCellBroadcast = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15);
		static final int TRANSACTION_disableCellBroadcastForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16);
		static final int TRANSACTION_enableCellBroadcastRange = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17);
		static final int TRANSACTION_enableCellBroadcastRangeForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18);
		static final int TRANSACTION_disableCellBroadcastRange = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19);
		static final int TRANSACTION_disableCellBroadcastRangeForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20);
		static final int TRANSACTION_getPremiumSmsPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 21);
		static final int TRANSACTION_getPremiumSmsPermissionForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 22);
		static final int TRANSACTION_setPremiumSmsPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 23);
		static final int TRANSACTION_setPremiumSmsPermissionForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 24);
		static final int TRANSACTION_isImsSmsSupported = (android.os.IBinder.FIRST_CALL_TRANSACTION + 25);
		static final int TRANSACTION_isImsSmsSupportedForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 26);
		static final int TRANSACTION_isSmsSimPickActivityNeeded = (android.os.IBinder.FIRST_CALL_TRANSACTION + 27);
		static final int TRANSACTION_getPreferredSmsSubscription = (android.os.IBinder.FIRST_CALL_TRANSACTION + 28);
		static final int TRANSACTION_getImsSmsFormat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29);
		static final int TRANSACTION_getImsSmsFormatForSubscriber = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30);
		static final int TRANSACTION_isSMSPromptEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31);
		static final int TRANSACTION_sendStoredText = (android.os.IBinder.FIRST_CALL_TRANSACTION + 32);
		static final int TRANSACTION_sendStoredMultipartText = (android.os.IBinder.FIRST_CALL_TRANSACTION + 33);

		public ProxyUiccSmsController(IBinder binder) {
			mBinder = binder;
			// mResorter = new SmsReceiverResorter(binder);
		}

		@Override
		protected boolean onTransact(int code, Parcel data, Parcel reply,
				int flags) throws RemoteException {

			switch (code) {
			case INTERFACE_TRANSACTION: {
				reply.writeString(DESCRIPTOR);
				return true;
			}
			case TRANSACTION_getAllMessagesFromIccEf: {}
			case TRANSACTION_getAllMessagesFromIccEfForSubscriber: {}
			case TRANSACTION_updateMessageOnIccEf: {}
			case TRANSACTION_updateMessageOnIccEfForSubscriber: {}
			case TRANSACTION_copyMessageToIccEf: {
				break;
			}
			case TRANSACTION_copyMessageToIccEfForSubscriber: {
				break;
			}
			case TRANSACTION_sendData: {
				data.enforceInterface(DESCRIPTOR);
				java.lang.String _arg0;
				_arg0 = data.readString();
				java.lang.String _arg1;
				_arg1 = data.readString();
				java.lang.String _arg2;
				_arg2 = data.readString();
				int _arg3;
				_arg3 = data.readInt();
				byte[] _arg4;
				_arg4 = data.createByteArray();
				android.app.PendingIntent _arg5;
				if ((0 != data.readInt())) {
					_arg5 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg5 = null;
				}
				android.app.PendingIntent _arg6;
				if ((0 != data.readInt())) {
					_arg6 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg6 = null;
				}
				Log.i(TAG, "sendData" + _arg0 + _arg1 + _arg2 + _arg3 + _arg4 + _arg5 + _arg6);
				break;
			}
			case TRANSACTION_sendDataForSubscriber: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				java.lang.String _arg1;
				_arg1 = data.readString();
				java.lang.String _arg2;
				_arg2 = data.readString();
				java.lang.String _arg3;
				_arg3 = data.readString();
				int _arg4;
				_arg4 = data.readInt();
				byte[] _arg5;
				_arg5 = data.createByteArray();
				android.app.PendingIntent _arg6;
				if ((0 != data.readInt())) {
					_arg6 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg6 = null;
				}
				android.app.PendingIntent _arg7;
				if ((0 != data.readInt())) {
					_arg7 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg7 = null;
				}
				Log.i(TAG, "sendDataForSubscriber" + _arg0 + _arg1 + _arg2 + _arg3 + _arg4 + _arg5 + _arg6 + _arg7);
				break;
			}
			case TRANSACTION_sendText: {
				data.enforceInterface(DESCRIPTOR);
				java.lang.String _arg0;
				_arg0 = data.readString();
				java.lang.String _arg1;
				_arg1 = data.readString();
				java.lang.String _arg2;
				_arg2 = data.readString();
				java.lang.String _arg3;
				_arg3 = data.readString();
				android.app.PendingIntent _arg4;
				if ((0 != data.readInt())) {
					_arg4 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg4 = null;
				}
				android.app.PendingIntent _arg5;
				if ((0 != data.readInt())) {
					_arg5 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg5 = null;
				}
				Log.i(TAG, "sendText" + _arg0 + _arg1 + _arg2 + _arg3 + _arg4 + _arg5);
				break;
			}
			case TRANSACTION_sendTextForSubscriber: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				java.lang.String _arg1;
				_arg1 = data.readString();
				java.lang.String _arg2;
				_arg2 = data.readString();
				java.lang.String _arg3;
				_arg3 = data.readString();
				java.lang.String _arg4;
				_arg4 = data.readString();
				android.app.PendingIntent _arg5;
				if ((0 != data.readInt())) {
					_arg5 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg5 = null;
				}
				android.app.PendingIntent _arg6;
				if ((0 != data.readInt())) {
					_arg6 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg6 = null;
				}
				Log.i(TAG, "sendTextForSubscriber" + _arg0 + _arg1 + _arg2 + _arg3 + _arg4 + _arg5 + _arg6);
				break;
			}
			case TRANSACTION_injectSmsPdu: {
				data.enforceInterface(DESCRIPTOR);
				byte[] _arg0;
				_arg0 = data.createByteArray();
				java.lang.String _arg1;
				_arg1 = data.readString();
				android.app.PendingIntent _arg2;
				if ((0 != data.readInt())) {
					_arg2 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg2 = null;
				}
				Log.i(TAG, "injectSmsPdu" + _arg0 + _arg1 + _arg2);
				break;
			}
			case TRANSACTION_sendMultipartText: {
				data.enforceInterface(DESCRIPTOR);
				java.lang.String _arg0;
				_arg0 = data.readString();
				java.lang.String _arg1;
				_arg1 = data.readString();
				java.lang.String _arg2;
				_arg2 = data.readString();
				java.util.List<java.lang.String> _arg3;
				_arg3 = data.createStringArrayList();
				java.util.List<android.app.PendingIntent> _arg4;
				_arg4 = data
						.createTypedArrayList(android.app.PendingIntent.CREATOR);
				java.util.List<android.app.PendingIntent> _arg5;
				_arg5 = data
						.createTypedArrayList(android.app.PendingIntent.CREATOR);
				Log.i(TAG, "sendMultipartText" + _arg0 + _arg1 + _arg2 + _arg3 + _arg4 + _arg5);
				break;
			}
			case TRANSACTION_sendMultipartTextForSubscriber: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				java.lang.String _arg1;
				_arg1 = data.readString();
				java.lang.String _arg2;
				_arg2 = data.readString();
				java.lang.String _arg3;
				_arg3 = data.readString();
				java.util.List<java.lang.String> _arg4;
				_arg4 = data.createStringArrayList();
				java.util.List<android.app.PendingIntent> _arg5;
				_arg5 = data
						.createTypedArrayList(android.app.PendingIntent.CREATOR);
				java.util.List<android.app.PendingIntent> _arg6;
				_arg6 = data
						.createTypedArrayList(android.app.PendingIntent.CREATOR);
				Log.i(TAG, "sendMultipartTextForSubscriber" + _arg0 + _arg1 + _arg2 + _arg3 + _arg4 + _arg5 + _arg6);
				break;
			}
			case TRANSACTION_enableCellBroadcast: {}
			case TRANSACTION_enableCellBroadcastForSubscriber: {}
			case TRANSACTION_disableCellBroadcast: {}
			case TRANSACTION_disableCellBroadcastForSubscriber: 
			case TRANSACTION_enableCellBroadcastRange: 
			case TRANSACTION_enableCellBroadcastRangeForSubscriber: 
			case TRANSACTION_disableCellBroadcastRange: {
				break;
			}
			case TRANSACTION_disableCellBroadcastRangeForSubscriber: {
				break;
			}
			case TRANSACTION_getPremiumSmsPermission: {
				data.enforceInterface(DESCRIPTOR);
				java.lang.String _arg0;
				_arg0 = data.readString();
				break;
			}
			case TRANSACTION_getPremiumSmsPermissionForSubscriber: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				java.lang.String _arg1;
				_arg1 = data.readString();
				break;
			}
			case TRANSACTION_setPremiumSmsPermission: {
				data.enforceInterface(DESCRIPTOR);
				java.lang.String _arg0;
				_arg0 = data.readString();
				int _arg1;
				_arg1 = data.readInt();
				break;
			}
			case TRANSACTION_setPremiumSmsPermissionForSubscriber: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				java.lang.String _arg1;
				_arg1 = data.readString();
				int _arg2;
				_arg2 = data.readInt();
				Log.i(TAG, "setPremiumSmsPermissionForSubscriber"+_arg0+""+_arg1);
				break;
			}
			case TRANSACTION_isImsSmsSupported: {
				data.enforceInterface(DESCRIPTOR);
				break;
			}
			case TRANSACTION_isImsSmsSupportedForSubscriber: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				break;
			}
			case TRANSACTION_isSmsSimPickActivityNeeded: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				break;
			}
			case TRANSACTION_getPreferredSmsSubscription: {
				data.enforceInterface(DESCRIPTOR);
				break;
			}
			case TRANSACTION_getImsSmsFormat: {
				data.enforceInterface(DESCRIPTOR);
				break;
			}
			case TRANSACTION_getImsSmsFormatForSubscriber: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				break;
			}
			case TRANSACTION_isSMSPromptEnabled: {
				data.enforceInterface(DESCRIPTOR);
				break;
			}
			case TRANSACTION_sendStoredText: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				java.lang.String _arg1;
				_arg1 = data.readString();
				android.net.Uri _arg2;
				if ((0 != data.readInt())) {
					_arg2 = android.net.Uri.CREATOR.createFromParcel(data);
				} else {
					_arg2 = null;
				}
				java.lang.String _arg3;
				_arg3 = data.readString();
				android.app.PendingIntent _arg4;
				if ((0 != data.readInt())) {
					_arg4 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg4 = null;
				}
				android.app.PendingIntent _arg5;
				if ((0 != data.readInt())) {
					_arg5 = android.app.PendingIntent.CREATOR
							.createFromParcel(data);
				} else {
					_arg5 = null;
				}
				break;
			}
			case TRANSACTION_sendStoredMultipartText: {
				data.enforceInterface(DESCRIPTOR);
				int _arg0;
				_arg0 = data.readInt();
				java.lang.String _arg1;
				_arg1 = data.readString();
				android.net.Uri _arg2;
				if ((0 != data.readInt())) {
					_arg2 = android.net.Uri.CREATOR.createFromParcel(data);
				} else {
					_arg2 = null;
				}
				java.lang.String _arg3;
				_arg3 = data.readString();
				java.util.List<android.app.PendingIntent> _arg4;
				_arg4 = data
						.createTypedArrayList(android.app.PendingIntent.CREATOR);
				java.util.List<android.app.PendingIntent> _arg5;
				_arg5 = data
						.createTypedArrayList(android.app.PendingIntent.CREATOR);
				break;
			}
			}

			return mBinder.transact(code, data, reply, flags);
		}
	}

	public static Object[] invoke() {
		IBinder activity_proxy = null;

		try {
			activity_proxy = new ProxyUiccSmsController(
					ServiceManager.getService("isms"));
			Log.i("TTT",
					">>>>>>>>>>>>>I am in, I am a bad boy 3!!!!<<<<<<<<<<<<<<");
		} catch (Exception e) {
			e.printStackTrace();
		}

		return new Object[] { "isms", activity_proxy };
	}
	
	public static Object[] hookConnectivityService(){
		IBinder activity_proxy = null;

		try {
			activity_proxy = new ProxyConnectivityService(
					ServiceManager.getService("connectivity"));
			Log.i("TTT",
					">>>>>>>>>>>>>I am in, I am a bad boy 3!!!!<<<<<<<<<<<<<<");
		} catch (Exception e) {
			e.printStackTrace();
		}

		return new Object[] { "connectivity", activity_proxy };
	}
}
